//
//  CNUserInfo.m
//  BeeQuick_19
//
//  Created by w on 16/9/25.
//  Copyright © 2016年 CN Team. All rights reserved.
//

#import "CNUserInfo.h"

@interface CNUserInfo()

@end
@implementation CNUserInfo

+ (instancetype)sharedInstance {
    
    static dispatch_once_t onceToken;
    static CNUserInfo *userInfo;
    dispatch_once(&onceToken, ^{
        userInfo = [[CNUserInfo alloc]init];
        [CNAddressData loadAdressData:^(NSArray *allAdress, NSError *error) {
            if (allAdress != nil) {
                userInfo.allAdress = [allAdress mutableCopy];
                userInfo.defaultAddress = allAdress[0];
            }
        }];
    });
    return userInfo;
}

- (Address *)defaultAddress
{
    return  _defaultAddress;
}
@end
